<!DOCTYPE html>
<html class="layui-bg-white">
<head th:include="include :: header"></head>
<body class="layui-bg-white">
<div class="layui-form" style="padding:20px;">
    <input id="ids" name="ids" type="hidden">
    <input id="id" name="id" th:value="${role.id}" type="hidden">
    <div class="layui-form-item">
        <label class="layui-form-label"><span class="required">*</span>名称：</label>
        <div class="layui-input-block">
            <input type="text" name="name" lay-verify="required" placeholder="请输入名称" autocomplete="off" class="layui-input" th:value="${role.name}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">备注：</label>
        <div class="layui-input-block">
            <input type="text" name="remark" placeholder="请输入备注" autocomplete="off" class="layui-input" th:value="${role.remark}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">权限：</label>
        <div class="layui-input-block">
            <div id="menuTree"></div>
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="LAY-operate-submit" id="LAY-operate-submit" value="确认">
    </div>
</div>
<div th:include="include :: footer"></div>
<script type="text/javascript">
    layui.config({
        base: ctx + '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index'         //主入口模块
    }).use(['index', 'tree'], function () {
        var tree = layui.tree;

        //初始化权限树
        commonJs.openAjax(ctx + "/manage/menu/menu/menuTree", {'id': $('#id').val()}, function (result) {
            tree.render({
                id: 'menuTree',
                elem: '#menuTree',
                data: result.data,
                showCheckbox: true
            });
        });
    })
</script>
</body>
</html>

